package com.trhui.mallbook.client;

import com.trhui.mallbook.domain.common.ApiRequest;
import com.trhui.mallbook.domain.common.BaseResponse;
import com.trhui.mallbook.domain.request.dg.DgUserEnterRequest;
import com.trhui.mallbook.domain.request.dg.DgUserEnterUpdateRequest;
import com.trhui.mallbook.domain.response.dg.DgUserEnterResponse;
import com.trhui.mallbook.domain.response.dg.DgUserEnterUpdateResponse;
import com.trhui.mallbook.enums.ChannelTypeEnum;
import com.trhui.mallbook.enums.ServerCodeEnum;

/**
 * 用户入驻
 * @author huangyl
 * 
 */
public class UserEnterClient extends AbstractClient {
    /**
     * 斗拱-用户入驻
     *
     * @param request
     * @return
     */
    public static BaseResponse<DgUserEnterResponse> userEnter(DgUserEnterRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.DG_USER_ENTER)
                .channelType(ChannelTypeEnum.DG)
                .build();
        return post(apiRequest, DgUserEnterResponse.class);
    }

    /**
     * 斗拱-用户入驻修改
     *
     * @param request
     * @return
     */
    public static BaseResponse<DgUserEnterUpdateResponse> userEnterUpdate(DgUserEnterUpdateRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.DG_USER_ENTER_UPDATE)
                .channelType(ChannelTypeEnum.DG)
                .build();
        return post(apiRequest, DgUserEnterUpdateResponse.class);
    }


}
